package com.onLineCar.dispatch.api;


import com.onLineCar.common.core.domain.Result;
import com.onLineCar.dispatch.entity.request.DispatchVehicleRequest;
import com.onLineCar.dispatch.service.DispatchVehicleService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhucaiyi
 * @since 2023-12-20
 */
@RestController
@RequestMapping("/dispatch")
public class DispatchVehicleController {

    @Resource
    private DispatchVehicleService dispatchVehicleService;

    /**
     * 调度汽车发送订单
     *
     * @return
     */
    @PostMapping("/dispatchVehicleSendOrder")
    public Result driverDistribution(@RequestBody DispatchVehicleRequest dispatchVehicleRequest) {
        return dispatchVehicleService.dispatchVehicleSendOrder(dispatchVehicleRequest);
    }

    @PostMapping("/receiveOrderCallback")
    public Result<String> receiveOrderCallback(@RequestBody HashMap<String, String> receiverOrderMap) {
        return dispatchVehicleService.receiveOrderCallback(receiverOrderMap);
    }

}

